package utils;

import android.app.Application;
import android.util.Log;


/**
 * 应用程序
 * Created by jiangwj on 2014/9/18.
 */
public abstract class BaseApplication extends Application {
    private static final String TAG = BaseApplication.class.getCanonicalName();


    @Override
    public void onCreate() {
        Log.i(TAG, "onCreate");
        super.onCreate();
        //
    }

    @Override
    public void onTerminate() {
        Log.i(TAG, "onTerminate");
        super.onTerminate();
    }

    /**
     * exit application
     */
    public void exit() {
        Log.i(TAG, "exit");
        AppActivities.instance().finishAll();
        //
        onExit();
        //
        Log.i(TAG, "System::exit(0)");
        System.exit(0);
    }

    protected void onExit() {}

}
